//
//  XKLLoginViewController.m
//  GuiZiShouDuanZi
//
//  Created by xmg on 16/4/28.
//  Copyright © 2016年 xiao_kl. All rights reserved.
//

#import "XKLLoginViewController.h"

@interface XKLLoginViewController ()
@property (weak, nonatomic) IBOutlet UIImageView *backImage;
//登录的越约束
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *loginContent;

@end

@implementation XKLLoginViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self.view insertSubview:self.backImage atIndex:0];
}
//退出响应者
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    [self.view endEditing:YES];
}

- (IBAction)zheCeButClick:(UIButton *)sender {
    //退出响应者
    [self.view endEditing:YES];
    
    //设置是否选中
    sender.selected=!sender.selected;
    //修改约束
    if (self.loginContent.constant==0) {
        
        self.loginContent.constant=-ScreenW;
    }else{
        self.loginContent.constant=0;
    }
    [UIView animateWithDuration:0.25 animations:^{
        [self.view layoutIfNeeded];
    }];
}

- (IBAction)dismissBut:(id)sender {
    [self.view endEditing:YES];
    [self dismissViewControllerAnimated:YES completion:nil];
}


//设置状态栏颜色
-(UIStatusBarStyle)preferredStatusBarStyle{
    return UIStatusBarStyleLightContent;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
